Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
The `tsc` npm package is the TypeScript compiler, which is used to compile TypeScript code into JavaScript. It provides a variety of functionalities including type checking, transpiling TypeScript to JavaScript, and generating declaration files.
Transpile TypeScript to JavaScript
This command takes a TypeScript file (`input.ts`) and compiles it into a JavaScript file (`output.js`).
tsc input.ts --outFile output.js
Type Checking
This command performs type checking on the TypeScript files in the project without emitting any JavaScript output. It is useful for ensuring type safety.
tsc --noEmit
Generate Declaration Files
This command generates a declaration file (`output.d.ts`) for the given TypeScript file (`input.ts`). Declaration files are useful for providing type information to other TypeScript projects.
tsc input.ts --declaration --outFile output.d.ts
Watch Mode
This command runs the TypeScript compiler in watch mode, which means it will recompile the project whenever a file changes. This is useful for development workflows.
tsc --watch
Project Compilation
This command compiles a TypeScript project based on the configuration specified in the `tsconfig.json` file. It allows for more complex project setups and configurations.
tsc --project tsconfig.json
Babel is a JavaScript compiler that can also transpile TypeScript to JavaScript. Unlike `tsc`, Babel focuses more on transforming modern JavaScript syntax and features to be compatible with older environments. It requires additional plugins to handle TypeScript.
esbuild is an extremely fast JavaScript bundler and minifier that also supports TypeScript. It is known for its speed and efficiency, but it does not perform type checking like `tsc` does.
swc (Speedy Web Compiler) is a super-fast TypeScript/JavaScript compiler written in Rust. It can be used to transpile TypeScript to JavaScript and is known for its performance. However, like esbuild, it does not perform type checking.
DEPRECATED. Use ntypescript
https://www.npmjs.com/package/ntypescript as it follows a simple orignal
-> noriginal
name transform for require
as well as globals tsc
& tsserver
.
FAQs
A deprecated release of the TypeScript compiler
The npm package tsc receives a total of 119,088 weekly downloads. As such, tsc popularity was classified as popular.
We found that tsc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.